# 99乘法表金字塔  = 99乘法表正序+88乘法表倒序

# i = 1
# while i <= 9:
#     j = 1
#     while j <= i:
#         print('%d*%d=%-4d' % (i, j, (i*j)), end='')
#         j += 1
#     print()
#     i += 1   #99乘法表正序
#
# i1 = 8
# while i1 >= 0:
#     j1 = 1
#     while j1 <= i1:
#         print('%d*%d=%-4d' % (i1, j1, (i1*j1)), end='')
#         j1 += 1
#     i1 -= 1
#     print()  #88乘法表倒序

# 在str中查找hello
# str1 = 'a,hello'
# print(str1.find('hello'))
#
# print(str1.index('hello'))

# 用逗号分割字符串，并保存到列表中
# my_list = []
# str = 'a,b,c,d'
# my_list = str.split(',')
# print(my_list)


# 将“笔试题123A”中 123 替换为 进行中
# str = '笔试题123A'
# str1 = str.replace('123', '进行中')
# print(str1)

# 输出整数0-10
# a = 0
# for a in range(0, 11):
#     print(a, end='')
#     a += 1

# a = 0
# while a <= 10:
#     print(a, end='')
#     a += 1

# 逆序输出字符串
# str = '北京欢迎你'
# str = str[::-1]
# print(str)
#石头剪刀布文字版
# import random
# list1 =['石头', '剪刀', '布']
# player = input('请输入石头，剪刀，布\n')
# if player not in list1:
#     print('输入错误，请重新输入')
# Num = random.randint(0, 2)
# computer = list1[Num]   #方式1
# computer = random.choice(list1) #方式2
# if (player == '石头' and computer == '剪刀') or (player == '剪刀' and computer == '布') or\
#         (player == '布' and computer == '石头'):
#     print('玩家出的是：%s 电脑出的是：%s，玩家获胜' % (player, computer))
# elif computer == player:
#     print('玩家出的是：%s 电脑出的是：%s，平局' % (player, computer))
# else:
#     print('玩家出的是：%s 电脑出的是：%s，电脑获胜' % (player, computer))
# 一个学校，10个老师，6个办公室，随机分配办公室
import random
room1 = ['', '', '', '', '', '', '', '', '', '']
room2 = ['', '', '', '', '', '', '', '', '', '']
room3 = ['', '', '', '', '', '', '', '', '', '']
room4 = ['', '', '', '', '', '', '', '', '', '']
room5 = ['', '', '', '', '', '', '', '', '', '']
room6 = ['', '', '', '', '', '', '', '', '', '']
school = [room1, room2, room3, room4, room5, room6]
teacher = ['t1', 't2', 't3', 't4', 't5', 't6', 't7', 't8','t9', 't10']
# print(list[0])
i = 1
while i <= 10:

    m = random.randint(0, 6)    #school下标
    j = random.randint(0, 10)   # room下标
    a = random.choice(teacher) #随机选取一位老师
    teacher.remove(a)         #将老师从teacher列表删除
    school[m][j] =a       #将选出来的老师随机分配到办公室room
    i += 1
for n in range(0, 6):        #去除列表中的‘’
    school[n].remove('')
    n += 1
school = [room1, room2, room3, room4, room5, room6]
print(school)

a = ()
print(type(a))